# -*- coding: utf-8 -*-
# File Name： __init__.py
# Description :
# Author : lirui
# create_date： 2022/6/3
# Change Activity:
from ....common.design_pattern.register.register_factory import REGISTER_FACTORY
from .dab_detr import DabDETR


def _build_registry():
    """
    build normal lay registry.

    """
    _register = REGISTER_FACTORY.create_registry('detector')
    _register.add('DabDETR', DabDETR)


_build_registry()  # build when module load.


def build_detector(cfg=None, callable_name=None):
    """
    Build detector from config.

    Args:
        callable_name:
        cfg:

    Returns:

    """
    return REGISTER_FACTORY.build_from_config('detector', cfg, callable_name)
